package com.lldpet.spring.cloud.demo.order.service.controller;

import cn.ygyg.bps.bus.starter.repository.BpsBusEventTraceRepository;
import cn.ygyg.common.utils.JsonUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @desc：BusTraceController
 * @author: guanliang.xue
 * @date: 2021/5/10 17:01
 * @version:
 * @since:
 */
@RestController
@RequestMapping("bus/trace")
public class BusTraceController {

    @Resource
    private BpsBusEventTraceRepository busTraceRepository;

    @GetMapping("list")
    public String list(){
        List<Map<String,Object>> customTraceList = busTraceRepository.findAll();
        return JsonUtils.toText(customTraceList);
    }
}
